package com.explorer.ider.bootguide.fragment;

import android.content.Context;
import android.content.Intent;
import android.content.pm.ApplicationInfo;
import android.content.pm.PackageInfo;
import android.content.pm.PackageManager;
import android.os.Bundle;
import android.os.Environment;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;
import android.widget.GridView;
import android.widget.ImageView;
import android.widget.LinearLayout;

import com.explorer.ider.bootguide.MainActivity;
import com.explorer.ider.bootguide.R;
import com.explorer.ider.bootguide.adapter.AppSelectAdapter;
import com.explorer.ider.bootguide.itembean.ApkInfo;

import java.io.BufferedReader;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.lang.reflect.Method;
import java.util.ArrayList;
import java.util.List;

/**
 * Created by Eric on 2017/9/19.
 */

public class FragmentZaiDian1 extends Fragment {


    private View views;
    private Button skip;
    private Button skip2;
    private Context context;
    private LinearLayout linearLayout;



    @Override
    public void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
    }

    @Nullable
    @Override
    public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
        context=getActivity();
        if (views == null){
            views = inflater.inflate(R.layout.fragment_zai_dian, container,false);

            linearLayout = (LinearLayout) views.findViewById(R.id.bg_id);
            linearLayout.setBackground(getResources().getDrawable(R.drawable.a1));
            skip = (Button)views.findViewById(R.id.complete);
            skip.setText(getResources().getString(R.string.next_step));
            skip.setOnClickListener(new View.OnClickListener() {
                @Override
                public void onClick(View v) {
                    toNextPager();
                }
            });

            skip2 = (Button)views.findViewById(R.id.complete2);
            skip2.setText(getResources().getString(R.string.download_later));
            skip2.setVisibility(View.VISIBLE);
            skip2.setOnClickListener(new View.OnClickListener() {
                @Override
                public void onClick(View v) {
                    toNextPager();
                }
            });


        }
        return views;
    }


    private void toNextPager(){
        Intent intent = new Intent();
        intent.setAction(MainActivity.ACTION_TO_NEXT_PAGER6);
        getActivity().sendBroadcast(intent);

    }


}
